package com.example.demojimmer.domain.userauth.model.entity;

import org.babyfish.jimmer.sql.ManyToMany;
import org.babyfish.jimmer.sql.MappedSuperclass;

import java.util.List;

/**
 * 保存关联关系映射
 * 权限/菜单;
 *
 * @author : liuhailong
 * @date : 2024-7-10
 */
@MappedSuperclass
public interface StPermissionMapping {

    /**
     * JoinTable的
     * name中间表表名: BOOK_AUTHOR_MAPPING
     * joinColumnName中间表指向当前实体的外键的列名: BOOK_ID
     * inverseJoinColumnName中间表指向关联实体的外键的列名: AUTHOR_ID
     *
     * @return
     */
    @ManyToMany(mappedBy = "permissions")
    List<StRole> roles();

}